<template>
  <!-- 轮播图组件 -->
  <div>
    <div>
      <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
        <van-swipe-item v-for="(d, index) in Img" :key="index" @click="addimg(d)">
          <img :src="d.img" alt="" />
        </van-swipe-item>
      </van-swipe>
    </div>
  </div>
</template>
<script>
import { Swipe, SwipeItem } from 'vant';
export default {
  name: 'App',
  props: {
    Img: {
      type: Array,
      default: function () {
        return [];
      },
    },
  },
  components: {
    [Swipe.name]: Swipe,
    [SwipeItem.name]: SwipeItem,
  },
  data() {
    return {};
  },
  methods: {
    // 轮播图点击事件
    addimg(e) {
      this.$emit('jump', e);
    },
  },
  mounted() {},
};
</script>
<style scoped>
.my-swipe .van-swipe-item img {
  width: 100%;
  height: 100%;
}
</style>
